home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 2 / Gold Medal Software Volume 2 (Gold Medal) (1994).iso / utils / scrldlg.arj / DLG.H next >
C/C++ Source or Header  |  1993-09-16  |  2KB  |  101 lines

  1. /*
  2.  
  3. File:    DLG.H
  4. Author:    Patrick Reilly (TeamB)  CIS: 71333,2764
  5. Date:    9/16/93
  6. Desc:    Header file for ScrollGroup and ScrollDialog classes.
  7.  
  8.     This file is the header file for a pair of classes that allow use of a
  9. scroll-able dialog box. It is designed for (but doesn't require) a TV.H-like
  10. master header file with the following lines:
  11.  
  12.     ...
  13.  
  14.     #ifdef    Uses_ScrollDialog
  15.     #define    Uses_TDialog
  16.     #define INC_DLG_H
  17.     #endif
  18.  
  19.     #ifdef    Uses_ScrollGroup
  20.     #define Uses_TGroup
  21.     #define INC_DLG_H
  22.     #endif
  23.  
  24.     ...
  25.  
  26.     #include <tv.h>
  27.  
  28.     ...
  29.  
  30.     #ifdef    INC_DLG_H
  31.     #include "Dlg.h"
  32.     #endif
  33.  
  34.     ...
  35.  
  36.  
  37. */
  38.  
  39. #if defined(Uses_ScrollGroup) && !defined(Def_ScrollGroup)
  40. #define Def_ScrollGroup
  41.  
  42. class TRect;
  43. class TScrollBar;
  44. class TEvent;
  45. class TBackground;
  46.  
  47. class ScrollGroupInit
  48. {
  49. public:
  50.  
  51.     ScrollGroupInit(TBackground* (*fn)(TRect)) : bkgdMaker(fn)
  52.     {}
  53.  
  54.     TBackground* (*bkgdMaker)(TRect);
  55. };
  56.  
  57. class ScrollGroup : public TGroup, public virtual ScrollGroupInit
  58. {
  59. public:
  60.  
  61.     ScrollGroup(const TRect&, TScrollBar*, TScrollBar*);
  62.  
  63.     virtual void changeBounds(const TRect&);
  64.     virtual void handleEvent(TEvent&);
  65.     virtual void scrollDraw();
  66.     virtual void scrollTo(int, int);
  67.     virtual void setLimit(int, int);
  68.     virtual void setState(ushort, Boolean);
  69.     virtual void focusSubView(TView*);
  70.  
  71.     static TBackground* initBackground(TRect);
  72.  
  73.     TScrollBar* hScrollBar;
  74.     TScrollBar* vScrollBar;
  75.     TBackground* background;
  76.     TPoint delta;
  77.     TPoint limit;
  78. };
  79.  
  80. #endif
  81.  
  82. #if defined(Uses_ScrollDialog) && !defined(Def_ScrollDialog)
  83. #define Def_ScrollDialog
  84.  
  85. class TRect;
  86. class TEvent;
  87. class ScrollGroup;
  88.  
  89. class ScrollDialog : public TDialog
  90. {
  91. public:
  92.  
  93.     ScrollDialog(const TRect&, const char*, ushort);
  94.  
  95.     virtual void handleEvent(TEvent&);
  96.  
  97.     ScrollGroup* scrollGroup;
  98. };
  99.  
  100. #endif
  101.